using System;

using System.Reflection;
using System.ComponentModel;
using CUtil;
using System.Diagnostics;
using System.Collections.Generic;

namespace CStock
{
	
	/// <summary>
	/// Summary description for StockObject.
	/// </summary>
    public class StockObjectFloat : StockObjectBase, IStockObjectFloat
	{
        

		
		[System.Xml.Serialization.XmlIgnoreAttribute()]
		protected IList<double> items;

		
		public StockObjectFloat(IStockObjectBase myParent)
		{
			this.parent = myParent;
			//keep empty constructor - the overriden constructor sets the collection:
			this.items = new List<double>();
		}
        public StockObjectFloat()
		{
			//keep empty constructor - the overriden constructor sets the collection:
			this.items = new List<double>();
		}

	
	
		[System.Xml.Serialization.XmlIgnoreAttribute()]
		public virtual IList<double> Items
		{
			get
			{
				return this.items;
			}
			set
			{
				this.items = value;
			}
		}
		
		[System.Xml.Serialization.XmlIgnoreAttribute()]
		public virtual double this [int index]
		{
			get 
			{
                if (this.items.Count > index)
                    //return (double) this.Items[index]; 
                    return (double)this.items[index];
                else
                {
                    Debug.Assert(false, "Error getting value - index out of bounds for index " + index.ToString() + "; for object : " + this.ToString());
                    return 0;
                }
			}
			set 
			{ 
				if (this.items.Count > index) 
					this.items[index] = value ; 
			}
		}

   
	}
	


}
